AUTOMAKE_OPTIONS= foreign
bin_PROGRAMS= countwords
countwords_SOURCES= ./src/countwords.c ./src/lexer.l 
LIBS= -ll
bindir= /usr/local/bin
infodir= /usr/local/share/doc/countwords

countwords:./src/Doxyfile countwords.o lexer.o -lfl	
	gcc countwords.o lexer.o -lfl -o countwords
	doxygen ./src/Doxyfile 
countwords.o: ./src/countwords.c
	gcc -c ./src/countwords.c
lexer.o: lexer.c
	gcc -c lexer.c
lexer.c: ./src/lexer.l
	flex -t ./src/lexer.l > lexer.c
install:
	cp -f countwords /usr/local/bin/	
	mkdir -p /usr/local/share/doc/countwords
	cp  -R ./doc/html/ /usr/local/share/doc/countwords/
	cp  -R ./doc/latex/ /usr/local/share/doc/countwords/	
	cp  ./doc/README /usr/local/share/doc/countwords/
uninstall:
	rm -rf /usr/local/share/doc/countwords \
	rm /usr/local/bin/countwords
